package com.own.business.log.operation.persistence.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.own.component.common.base.entity.po.BaseBean;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * LogOperation
 *
 * @author chenxueli
 * @date 2023-08-09 10:24:19
 */
@Schema(title = "操作日志持久化" + ConstantBeanSuffix.PO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "own_log_operation")
public class LogOperation extends BaseBean implements Serializable {

    @Schema(title = "操作编码")
    private String code;

    @Schema(title = "响应信息")
    private String message;

    @Schema(title = "登录令牌")
    private String token;

    @Schema(title = "用户id")
    private Long fkUserId;

    @Schema(title = "用户名")
    private String userName;

    @Schema(title = "状态 1=成功 2=失败")
    private Integer status;

    @Schema(title = "方法名（全限定名）")
    private String methodName;

    @Schema(title = "客户端")
    private String client;

    @Schema(title = "ip")
    private String ip;

    @Schema(title = "模块名称")
    private String moduleName;

    @Schema(title = "操作名称")
    private String operationName;

    @Schema(title = "额外信息")
    private String extra;

    @Schema(title = "请求时间")
    private LocalDateTime requestTime;

    @Schema(title = "请求参数")
    private String requestParams;

    @Schema(title = "响应时间")
    private LocalDateTime responseTime;

    @Schema(title = "响应参数")
    private String responseParams;

    @Schema(title = "链路id")
    private String traceId;

    @Schema(title = "等级")
    private Integer level;

}
